#include <iostream>
using namespace std;
int main()
{
    struct Point
    {
        int x;
        int y;
        // c++的结构体可以声明方法
        // struct 默认 public
        void print() // 等价于 void print(Point* const this)
        {
            cout << "print is runing" << endl;
            // 已下写法等价，this可以省略
            cout << "x is " << this->x << endl;
            cout << "y is " << this->y << endl;
            cout << "x is " << x << endl;
            cout << "y is " << y << endl;
        }
    };
    Point p1{1, 2};
    p1.print();
    return 0;

    //  在 C++ 里，struct 和 class 的唯一语法差别是默认访问级别：
    // struct 默认 public
    // class  默认 private
}
